package org.wlgzs.shop.bean;

import lombok.Data;
import org.hibernate.validator.constraints.Email;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
public class UserDate {
    public UserDate(Integer userId, String userName, Integer integral, Integer power, String post) {
        this.userId = userId;
        this.userName = userName;
        this.integral = integral;
        this.power = power;
        this.post = post;
    }
    public UserDate(){};
    /**
     *
     *用户id
     */
    private Integer userId;

    /**
     *
     *用户名
     */
    @NotNull
    @Pattern(regexp = "^[\\w\\u4e00-\\u9fa5]{1,6}$",message = "请输入1-6位的英文、数字、中文、下划线")
    private String userName;

    /**
     *
     *密码
     */
    @NotNull
    @Pattern(regexp = "^[\\w]{6,12}$",message = "请输入6-12位的英文、数字、下划线")
    private String password;

    /**
     *
     *用户积分
     */
    private Integer integral;

    /**
     *
     *用户余额
     */
    private Float money;

    /**
     *
     *用户权限[/会员/商家/用户]
     */
    private Integer power;

    /**
     *
     *邮箱
     */
    @NotNull
    @Pattern(regexp = "^([a-zA-Z]|[0-9])(\\w|\\-)+@[a-zA-Z0-9]+\\.([a-zA-Z]{2,4})$",message = "邮箱输入有误")
    private String post;

    /**
     *
     *手机
     */
    @NotNull
    @Pattern(regexp = "^[1][3,4,5,7,8][0-9]{9}$",message = "手机号输入有误")
    private String phone;

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName == null ? null : userName.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public Integer getIntegral() {
        return integral;
    }

    public void setIntegral(Integer integral) {
        this.integral = integral;
    }

    public Float getMoney() {
        return money;
    }

    public void setMoney(Float money) {
        this.money = money;
    }

    public Integer getPower() {
        return power;
    }

    public void setPower(Integer power) {
        this.power = power;
    }

    public String getPost() {
        return post;
    }

    public void setPost(String post) {
        this.post = post == null ? null : post.trim();
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone == null ? null : phone.trim();
    }

}